{extend name="index/index" /}
{block name="index"}
        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                被禁用的用户列表
            </div>
            <ol class="am-breadcrumb">
                <li><a href="{:url('admin/Index/index')}" class="am-icon-home">首页</a></li>
                <!-- <li><a href="#">Amaze UI CSS</a></li> -->
                <li class="am-active">被禁用的用户列表</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                    </div>


                </div>
                <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
<!--                                     <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span> 保存</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button> -->
                                </div>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-3">
                        </div>
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <form action="{:url('admin/HmyUser/index')}">
                                    <input type="text" name="title" class="am-form-field" style="width: 185px" placeholder="请输入用户名">
                                    <span class="am-input-group-btn">
                                        <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
                                    </span>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                            <th class="table-id">ID</th>
                                            <th class="table-title">姓名</th>
                                            <th class="table-title">电话</th>
                                            <th class="table-title">状态</th>
                                            <th class="table-type">性别</th>
                                            <th class="table-type">年龄</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {empty name="data"}
                                    <tr><td colspan="7" align="center">暂无数据</td></tr>
                                    {else /}
                                        {volist name="data" id="v"}
                                        <tr>
                                            <td>{$v['id']}</td>
                                            <td>{$v['name']}</td>
                                            <td>{$v['tel']}</td>
                                            {if condition="$v.status eq 1"}
                                            <td><font color="green" size="2"><strong>运行中</font></strong></td>
                                            {else /}
                                            <td><font color="red"><strong>禁用中</strong></font></td>
                                            {/if}</td>
                                            {if condition="$v.sex eq 1"}
                                            <td>男</td>
                                            {else /}
                                            <td>女</td>
                                            {/if}</td>
                                            <td>
                                                {empty name="v.age"}
                                                <font color="red">未添加</font>
                                                {else/}
                                                {$v['age']}
                                                {/empty}
                                            </td>
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                        <a href="{:url('admin/HmyUser/find',['id'=>$v['id']])}" class="am-btn am-btn-default am-btn-xs am-text-secondary" style="background: white;color:skyblue">
                                                            <span class="am-icon-pencil-square-o"></span>查看详情</a>
                                                        <a href="javascript:void(0);" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" style="color: red;background:white" onclick="status(this,'{$v['id']}')" title="启用"><span class="am-icon-trash-o"></span>启用</a>

                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        {/volist}
                                    {/empty}
                                    </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        {$page}
                                    </div>
                                </div>
                                <hr>

                            </form>
                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>

        </div>

    <script src="/static/admin/assets/js/toastr.min.js"></script>
    <script src="/static/admin/assets/js/jquery.min.js"></script>
    <script src="/static/admin/assets/js/jquery-1.8.3.min.js"></script>
    <script src="/static/admin/assets/js/my.js"></script>

<!-- 管理员禁用 -->
    <script>

            function status(obj,id){

                $.ajax({
                    url:"/findHmy",
                    Type:'get',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){

                      if (data.status) {
                        
                          toastr.success(data.msg);
                          window.location.reload();

                      } else {
                          toastr.error(data.msg);
                      }

                    },
                    error:function(data){
                        toastr.error('系统故障,请联系管理员');
                    }
                });
            }

    </script>
{/block}
